import { defineConfig } from 'vitepress'
import git from '../git'
import mysql from '../mysql'

// https://vitepress.dev/reference/site-config
export default defineConfig({
  title: 'cyan 的文档站',
  lang: 'zh-Hans',
  description: 'cyan 的文档站-知识库',
  head: [
    [
      'link',
      { rel: 'icon', href: 'https://assets.emptycyan.cn/docs-assets/vitepress-logo-mini.png' }
    ]
  ],
  themeConfig: {
    // https://vitepress.dev/reference/default-theme-config
    logo: 'https://assets.emptycyan.cn/docs-assets/vitepress-logo-mini.png',

    search: {
      provider: 'local',
      options: {
        placeholder: '搜索文档',
        translations: {
          button: {
            buttonText: '搜索文档',
            buttonAriaLabel: '搜索文档'
          },
          modal: {
            searchBox: {
              resetButtonTitle: '清除查询条件',
              resetButtonAriaLabel: '清除查询条件',
              cancelButtonText: '取消',
              cancelButtonAriaLabel: '取消'
            },
            startScreen: {
              recentSearchesTitle: '搜索历史',
              noRecentSearchesText: '没有搜索历史',
              saveRecentSearchButtonTitle: '保存至搜索历史',
              removeRecentSearchButtonTitle: '从搜索历史中移除',
              favoriteSearchesTitle: '收藏',
              removeFavoriteSearchButtonTitle: '从收藏中移除'
            },
            errorScreen: {
              titleText: '无法获取结果',
              helpText: '你可能需要检查你的网络连接'
            },
            footer: {
              selectText: '选择',
              navigateText: '切换',
              closeText: '关闭',
              searchByText: '搜索提供者'
            },
            noResultsScreen: {
              noResultsText: '无法找到相关结果',
              suggestedQueryText: '你可以尝试查询',
              reportMissingResultsText: '你认为该查询应该有结果？',
              reportMissingResultsLinkText: '点击反馈'
            }
          }
        }
      }
    },

    nav: [
      { text: '首页', link: '/' },
      { text: 'Git', link: '/git/' },
      { text: 'MySQL', link: '/mysql/' }
    ],

    sidebar: { ...git, ...mysql },

    socialLinks: [
      { icon: 'bilibili', link: 'https://space.bilibili.com/584930152' },
      { icon: 'gitee', link: 'https://gitee.com/jiejiebiezheyang/cyan-docs' }
    ],

    footer: {
      message: 'Released under the MIT License.',
      copyright: 'Copyright © 2025-present Cyan'
    },

    ...{
      docFooter: {
        prev: '上一页',
        next: '下一页'
      },

      outline: {
        label: '页面导航'
      },

      lastUpdated: {
        text: '最后更新于',
        formatOptions: {
          dateStyle: 'long',
          timeStyle: 'short'
        }
      },

      notFound: {
        title: '页面未找到',
        quote: '但如果你不改变方向，并且继续寻找，你可能最终会到达你所前往的地方。',
        linkLabel: '前往首页',
        linkText: '带我回首页'
      },

      langMenuLabel: '多语言',
      returnToTopLabel: '回到顶部',
      sidebarMenuLabel: '菜单',
      darkModeSwitchLabel: '主题',
      lightModeSwitchTitle: '切换到浅色模式',
      darkModeSwitchTitle: '切换到深色模式',
      skipToContentLabel: '跳转到内容'
    }
  }
})
